package com.epam.OOP.utils;

import java.io.UnsupportedEncodingException;
import java.util.Locale;
import java.util.ResourceBundle;

/**
 * Created with IntelliJ IDEA.
 * User: Yelena_M
 * Date: 05.08.13
 * Time: 0:22
 * To change this template use File | Settings | File Templates.
 */
public class BundlesReader {

    public static String read(String bundleName) throws UnsupportedEncodingException {
        String text = "";
        Locale locale = Locale.getDefault();
        ResourceBundle bundle = ResourceBundle.getBundle("com.epam.OOP.Resource", locale);
        text = bundle.getString(bundleName);

        //Посмотреть потоки с UTF8
        //return new String(text.getBytes("Windows-1252"), "UTF-8");
        return text;
    }
}
